home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / Include / FWPolySh.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-08  |  3.7 KB  |  138 lines  |  [TEXT/MPS ]

  1. #ifndef FWPOLYSH_H
  2. #define FWPOLYSH_H
  3.  
  4. //========================================================================================
  5. //
  6. //    File:                FWPolySh.h
  7. //    Release Version:    $ 1.0d11 $
  8. //
  9. //    Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //========================================================================================
  12.  
  13. #ifndef FWSHAPE_H
  14. #include "FWShape.h"
  15. #endif
  16.  
  17. #ifndef FWRECT_H
  18. #include "FWRect.h"
  19. #endif
  20.  
  21. #ifndef FWPOLY_H
  22. #include "FWPoly.h"
  23. #endif
  24.  
  25. #ifndef FWGCONST_H
  26. #include "FWGConst.h"
  27. #endif
  28.  
  29. #if FW_LIB_EXPORT_PRAGMAS
  30. #pragma lib_export on
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Forward Declarations
  35. //========================================================================================
  36.  
  37. class FW_CLASS_ATTR FW_CGraphicContext;
  38.  
  39. //========================================================================================
  40. //    class FW_CPolygonShape
  41. //========================================================================================
  42.  
  43. class FW_CLASS_ATTR FW_CPolygonShape : public FW_CShape
  44. {
  45. public:
  46.     FW_DECLARE_CLASS
  47.  
  48. //---------------------------------------------------------------------------------------
  49. //    Constructors/Destructors
  50. //
  51. public:
  52.     FW_CPolygonShape(const FW_PPolygon& polygon,
  53.                      FW_ERenderVerbs renderVerb,
  54.                      FW_Boolean autoCloseFrame,
  55.                      const FW_PInk& ink = FW_kNormalInk,
  56.                      const FW_PStyle& style = FW_kNormalStyle);
  57.  
  58.     FW_CPolygonShape(const FW_CPolygonShape& other);
  59.     FW_CPolygonShape(FW_CReadableStream& archive);
  60.     
  61.     virtual ~FW_CPolygonShape();
  62.  
  63. //----------------------------------------------------------------------------------------
  64. //    Operators
  65. //
  66. public:
  67.     FW_CPolygonShape& operator=(const FW_CPolygonShape& other);
  68.  
  69. //---------------------------------------------------------------------------------------
  70. //    New API
  71. //
  72. public:
  73.     void                    SetAutoCloseFrame(FW_Boolean autoCloseFrame);
  74.     FW_Boolean                GetAutoCloseFrame() const;
  75.  
  76. //---------------------------------------------------------------------------------------
  77. //    Inherited API
  78. //
  79. public:
  80.     // ----- Rendering -----
  81.     virtual void            Render(FW_CGraphicContext& gc) const;
  82.  
  83.     // ----- Hit Testing -----
  84.     virtual FW_Boolean     HitTest(FW_CGraphicContext& gc,
  85.                                     const FW_CPoint& test,
  86.                                     FW_CFixed tolerance) const;
  87.     
  88.     // ----- Copying -----
  89.     virtual FW_CShape*        Copy() const;
  90.     
  91.     // ----- Transform -----
  92.     virtual void            Transform(Environment *ev, ODTransform* transform);
  93.     virtual void            InverseTransform(Environment *ev, ODTransform* transform);
  94.  
  95.     virtual void            MoveShape(FW_CFixed deltaX, FW_CFixed deltaY);
  96.     virtual void            MoveShapeTo(FW_CFixed x, FW_CFixed y);
  97.  
  98.     virtual void            Inset(FW_CFixed x, FW_CFixed y);
  99.     
  100.     // ----- Geometry -----
  101.     virtual void             GetBounds(FW_CGraphicContext& gc, FW_CRect& rect) const;
  102.  
  103.     // ----- Flatten -----
  104.     virtual void            Flatten(FW_CWritableStream& archive) const;
  105.     
  106. //---------------------------------------------------------------------------------------
  107. //    New API
  108. //
  109. public:
  110.     // ----- Rendering -----
  111.     static void        RenderPolygon(FW_CGraphicContext& gc,
  112.                                     const FW_PPolygon& polygon,
  113.                                   FW_ERenderVerbs renderVerb,
  114.                                   FW_Boolean autoCloseFrame,
  115.                                     const FW_PInk& ink = FW_kNormalInk,
  116.                                     const FW_PStyle& style = FW_kNormalStyle);
  117.  
  118.     // ----- Archiving -----
  119.     static void*     Read(FW_CReadableStream& archive);
  120.  
  121.     // ----- Geometry -----
  122.     void            GetGeometry(FW_PPolygon& polygon) const;
  123.     void            SetGeometry(const FW_PPolygon& polygon);
  124.  
  125. //---------------------------------------------------------------------------------------
  126. //    Data Members
  127. //
  128. private:
  129.     FW_PPolygon fPolygon;
  130.     FW_Boolean fAutoCloseFrame;
  131. };
  132.  
  133. #if FW_LIB_EXPORT_PRAGMAS
  134. #pragma lib_export off
  135. #endif
  136.  
  137. #endif // FWPOLYSH_H
  138.